package tests;

import common.Utils;
import org.openqa.selenium.By;

public class DetailPage extends Utils {
    public static String url = "http://127.0.0.1:58080/index.html";
    public DetailPage() {
        super(url);
    }

    /**
     * clickpost
     * 点击帖子详情页
     */
    public void clickpost() {
        driver.findElement(By.cssSelector("#artical-items-body > div:nth-child(1) > div > div.col > div.text-truncate > a")).click();
    }

    /**
     * postTitle
     * 帖子标题
     */
    public void postTitle() {
        driver.findElement(By.cssSelector("#details_article_title"));
    }

    /**
     * sendMessage
     * 发私信
     */
    public void sendMessage() {
        driver.findElement(By.cssSelector("#btn_details_send_message"));
    }

    /**
     * like
     * 点赞
     */
    public void like() {
        driver.findElement(By.cssSelector("#details_btn_like_count"));
    }

    /**
     * reply
     * 回复
     */
    public void reply() {
        driver.findElement(By.cssSelector("#bit-forum-content > div.page-body > div > div > div:nth-child(2) > h3"));
    }

    /**
     * clickReply
     * 点击回复
     */
    public void clickReply() {
        driver.findElement(By.cssSelector("#details_btn_article_reply"));
        driver.navigate().refresh();
    }

}
